package com.itheima.dao;

import com.itheima.domain.Emp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmpDao {

    @Insert("insert into emp values (#{id},#{ename},#{gender},#{salary},#{address},#{dept_id})")
    void add(Emp emp);


    @Select("SELECT e.*, d.dname FROM emp e, dept d WHERE e.dept_id=d.id")
    List<Emp> findAll();

}
